home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / include / a.out.sun4.h < prev    next >
Text File  |  1992-09-11  |  1KB  |  35 lines

  1. /* SPARC-specific values for a.out files */
  2.  
  3. #define PAGE_SIZE    0x2000        /* 8K.  aka NBPG in <sys/param.h> */
  4. /* Note that some SPARCs have 4K pages, some 8K, some others.  */
  5.  
  6. #define SEG_SIZE_SPARC    PAGE_SIZE
  7. #define    SEG_SIZE_SUN3    0x20000        /* Resolution of r/w protection hw */
  8.  
  9. #define TEXT_START_ADDR    PAGE_SIZE    /* Location 0 is not accessible */
  10.  
  11. /* Non-default definitions of the accessor macros... */
  12.  
  13. /* Segment size varies on Sun-3 versus Sun-4.  */
  14.  
  15. #define N_SEGSIZE(x)    (N_MACHTYPE(x) == M_SPARC?    SEG_SIZE_SPARC:    \
  16.              N_MACHTYPE(x) == M_68020?    SEG_SIZE_SUN3:    \
  17.             /* Guess? */            PAGE_SIZE)
  18.  
  19. /* Offset in a.out file of the text section.  For ZMAGIC, the text section
  20.    actually includes the a.out header.  */
  21.  
  22. #define N_TXTOFF(x)    ( (N_MAGIC((x)) == ZMAGIC) ? 0 : EXEC_BYTES_SIZE)
  23.  
  24. /* Virtual Address of text segment from the a.out file.  For OMAGIC,
  25.    (almost always "unlinked .o's" these days), should be zero.
  26.    Sun added a kludge so that shared libraries linked ZMAGIC get
  27.    an address of zero if a_entry (!!!) is lower than the otherwise
  28.    expected text address.  These kludges have gotta go!
  29.    For linked files, should reflect reality if we know it.  */
  30.  
  31. #define N_TXTADDR(x) \
  32.     (N_MAGIC(x)==OMAGIC? 0 \
  33.      : (N_MAGIC(x) == ZMAGIC && (x).a_entry < TEXT_START_ADDR)? 0 \
  34.      : TEXT_START_ADDR)
  35.